NumToString
NumToString
Convert 32-bit integer to string of decimal digits #include <BDC.h> Binary-Dec. Pack.
long theNum ; 32-bit signed value to convert
Str255 theString ; address of buffer to receive p- string NumToString creates a string of decimal digits representing the value of a 32-bit signed integer.
theNum is a signed long integer.
theString is the address of a buffer. Upon return, it will contain a
pascal-style length-prefixed string of decimal digits. If the number
is less than 0, the string will start with a minus sign. Leading zeros
are removed, except that if theNum is 0, theString is "0".
Note: The theString buffer need be no longer than 12 bytes (a length byte, a minus sign, and 10 digits).
Notes: The range is from -2,147,483,647 to +2,147,483,648.
No comma-insertion or other formatting is performed.
Example
char numStr[12];
long theNum;